﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twodi.Interfaces;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Twodi.Implemented
{
    public class TextItem : Label, IMenuItem
    {
        protected String value;

        public TextItem(String value, SpriteFont font, Game game)
            : base(font, game)
        {
            this.Value = value;
        }

        public String Value
        {
            get { return this.value; }
            set
            {
                this.value = value;
                onValueChanged(EventArgs.Empty);
            }
        }

        public event EventHandler<EventArgs> ValueChanged;

        protected virtual void onValueChanged(EventArgs e)
        {
            if (ValueChanged != null)
            {
                ValueChanged(this, e);
            }
        }
    }
}
